DECLARE FUNCTION hexx$ (value!)
OPEN "c:\romhack\trans\free6\clear.dat" FOR BINARY AS #1
OPEN "c:\romhack\trans\free6\clear.txt" FOR OUTPUT AS #2

byte$ = " "
x = -1
posi& = LOF(1)

PRINT #2, "  %data ";

DO
 GET #1, , byte$
 
 IF x = 15 THEN
   PRINT #2,
   PRINT #2, "  %data  $" + hexx$(VAL(STR$(ASC(byte$))));
   x = 0
 ELSE
   PRINT #2, " $" + hexx$(VAL(STR$(ASC(byte$))));
   x = x + 1
 END IF

 posi& = posi& - 1
LOOP UNTIL posi& = 0
CLOSE

FUNCTION hexx$ (value)

 strng$ = HEX$(value)
 IF (LEN(strng$) AND 1) = 1 THEN
   strng$ = "0" + strng$
 END IF

  hexx$ = strng$
END FUNCTION

